{% extends "share/base.html" %}
{% load static %}

{% block content %}
<form method="post">
{% csrf_token %}
  <table>
  {{ form }}
  <tr><td></td><td><img id='captcha' src="{% url 'share:gen_captcha' %}"></td></tr>
  <tr><td colspan=2><input type="submit" value="Login"></td></tr>
  </table>
</form>

<script type="text/javascript" src="{% static 'share/js/jquery.min.js' %}"></script>
<script>
function reload_img() {
  $('#captcha').attr('src', "{% url 'share:gen_captcha' %}" + String(Math.random()));
}
$(document).ready(function() {
    $('#captcha').click(reload_img);
});
</script>

{% endblock %}
